]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
automountManager: Cancel operations on disable
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 7 Sep 2026 18:39:01 +0000 (20:39 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 13 Sep 2026 17:39:10 +0000 (19:39 +0200)
We stop monitoring volumes when disabling automounts, but active
operations remain in place. As a result, it is possible for mount
password dialogs to show on the lock screen.

This is at least unexpected, so use a cancellable to make sure
ongoing operations are aborted when the automount manager is
disabled.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4393>
(cherry picked from commit fea948928fe5885c1f0e8c5b928d753dfb1c57a8)

js/ui/components/automountManager.js

index 5ea1e2e12baa8eb8db69a25014c6b627447b8621..63255c83a64d162614fe250b1ca6b5b9d2e33888 100644 (file)
@@ -29,6 +29,8 @@ class AutomountManager {
     }
 
     enable() {
+        this._cancellable = new Gio.Cancellable();
+
         this._volumeMonitor.connectObject(
             'volume-added', this._onVolumeAdded.bind(this),
             'volume-removed', this._onVolumeRemoved.bind(this),
@@ -41,6 +43,9 @@ class AutomountManager {
     }
 
     disable() {
+        this._cancellable?.cancel();
+        this._cancellable = null;
+
         this._volumeMonitor.disconnectObject(this);
 
         if (this._mountAllId > 0) {
@@ -176,7 +181,7 @@ class AutomountManager {
         const mountOp = operation?.mountOp ?? null;
         this._activeOperations.set(volume, operation);
 
-        volume.mount(0, mountOp, null,
+        volume.mount(0, mountOp, this._cancellable,
             this._onVolumeMounted.bind(this));
     }